<template>
	<view>
		<u-navbar title-color="#333" title-bold title-size="36" title="消息" :border-bottom="false"></u-navbar>
		<view class="u-padding-32">
			<view class="font_16_333 font_weight u-m-t-32 text_center" v-if="detail.title">
				{{detail.title}}
			</view>
			<view class="font_12_666 u-m-t-16 text_center" v-if="detail.created_at">
				{{detail.created_at}}
			</view>
			<view class="u-m-t-40" v-if="richText">
				<rich-text :nodes="richText"></rich-text>
				<!-- {{detail.created_at}} -->
			</view>
		</view>
		
	</view>
</template>

<script>
	import { formatRichText } from '@/static/richText.js'
	export default {
		data() {
			return {
				id:'',
				detail:[],
				richText: '',
			}
		},
		onLoad(e) {
			this.id = e.id
			this.getdetail()
		},
		methods: {
			getdetail(){
				this.$api({
					url: '/getNotice',
					method: 'get',
					data: {
						id:this.id
						
					},
				}).then(res => {
					if (res.code == 1) {
						this.detail=res.data
						this.richText = formatRichText(res.data.content)
					}
				})
			}
		}
	}
</script>

<style>

</style>
